package org.anderground.editor.gui.toolbar;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JToggleButton;
import javax.swing.JToolBar;

import org.anderground.editor.gui.MainWindow;
import org.anderground.editor.gui.view.standard.ViewTriggers;

public class EditorToolBar extends JToolBar {
	public EditorToolBar(MainWindow parent) {
		this.add(new FileToolBar(parent));
		this.add(new StateToolBar(parent));
		this.add(new SelectionToolBar());
		this.add(new ShowNameButton());
		this.add(new LineToolBar(parent));
	}

	class ShowNameButton extends JToggleButton {
		public ShowNameButton() {
			super("Show name");
			this.setSelected(true);
			addActionListener(new ActionListener() {

				@Override
				public void actionPerformed(ActionEvent arg0) {
					ViewTriggers.showStationsLabels = ShowNameButton.this
							.isSelected();
					// TODO
					// EditorModel.getInstance().modelChanged(false); // need to
					// repaint
					// views
				}

			});
		}
	}
}